var inProgress = false;
var Opened = new Array();
var tmr, bl, dl;
	function SDown(bel, del) 
	{
		if($('#'+del).is(":hidden"))
		{
			$('#'+del).slideDown(300,function()
			{
				$(this).filter(".middle").focus();
			});
		} else
		{
			inProgress = false;
		}
	}

	function SUp() 
	{
		for(var x in Opened)
		{
			if(inProgress || Opened[x] != dl)
			{
				$('#'+Opened[x]).slideUp(200,function()
				{
					$(this).filter(".middle").focus();
					inProgress = false;
					Opened[x] = false;
				});
			}
		}
	}

	function Trg(bel, del)
	{
		bl = bel;
		dl = del;
		inProgress = del;
		Opened[bel] = del;
		tmr = window.setTimeout(SUp,30);
	}